package com.haz.mybatis.test;

import com.haz.mybatis.mapper.ParameterMapper;
import com.haz.mybatis.pojo.User;
import com.haz.mybatis.utils.SqlsessionUtils;
import org.junit.Test;

import java.io.IOException;
import java.util.List;

public class testParameter {
    @Test
    public void testGetAllUser()  {
        // 1.连接数据库，获取session对象
        ParameterMapper mapper = SqlsessionUtils.getsqlSession().getMapper(ParameterMapper.class);
        // 2.执行SQL语句
        List<User> list = mapper.getAllUser();
        list.forEach(user -> System.out.println(user));
    }
}
